﻿using System.Windows.Forms;

namespace ScriptEase.Shell.Controls
{
    public partial class ProjectConfigurationEditor : Form
    {
        public ProjectConfigurationEditor()
        {
            InitializeComponent();
        }


        public void SetConfig( ProjectConfiguration projectConfiguration)
        {
            this.textBaseDirectory.Text = projectConfiguration.BaseDirectory;
            this.textPublisherPrefixes.Text = projectConfiguration.RemovePublisherPrefixes;
            this.checkAutoPublish.Checked = projectConfiguration.AutoPublish;
            this.checkAutoUpdate.Checked = projectConfiguration.AutoUpdate;
            this.checkIncludeManaged.Checked = projectConfiguration.IncludeManaged;
        }

        public void GetConfig(ProjectConfiguration projectConfiguration)
        {
            projectConfiguration.BaseDirectory = this.textBaseDirectory.Text;
            projectConfiguration.RemovePublisherPrefixes = this.textPublisherPrefixes.Text;
            projectConfiguration.AutoPublish = this.checkAutoPublish.Checked;
            projectConfiguration.AutoUpdate = this.checkAutoUpdate.Checked;
            projectConfiguration.IncludeManaged = this.checkIncludeManaged.Checked;

        }
    }
}
